<?php
session_start();
ob_start();
include 'lang.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> ELISSH</title>
<link rel="icon" type="image/x-icon" href="images/favicon_16x16.ico"></link>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/1234.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language="></script>
<script type="text/javascript">
$(function(){
	<?php if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="about_content"){?>
	$('li#menu_about').css("background","#1692cf");
	$('a#menu_about').css("color","#1692cf");
	<?php }else if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="products_content"){?>
	$('li#menu_products').css("background","#1692cf");
	$('a#menu_products').css("color","#1692cf");
	<?php }else if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="download_content"){?>
	$('li#menu_download').css("background","#1692cf");
	$('a#menu_download').css("color","#1692cf");
	<?php }else if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="contact_content"){?>
	$('li#menu_contact').css("background","#1692cf");
	$('a#menu_contact').css("color","#1692cf");
	<?php }else if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="admin_searchlog_content"){?>
	$('li#menu_searchlog').css("background","#1692cf");
	$('li#menu_searchlog').css("border-radius", "4px 0px 0px 4px");
	$('a#menu_searchlog').css("color","#1692cf");
	<?php }else if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="admin_login_content"){?>
	$('li#menu_home').css("background","#1692cf");
	$('li#menu_home').css("border-radius", "4px 0px 0px 4px");
	$('a#menu_home').css("color","#1692cf");
	document.getElementById("iduser").focus();
	<?php }else{ ?>
	$('li#menu_home').css("background","#1692cf");
	$('li#menu_home').css("border-radius", "4px 0px 0px 4px");
	$('a#menu_home').css("color","#1692cf");
	<?php }?>
});

var map;
function initialize() {
      var myLatlng = new google.maps.LatLng( 37.487276,127.022042);
      var myOptions = {
    zoom: 14,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("div_id"), myOptions); 
  // BiÃ¡ÂºÂ¿n text chÃ¡Â»Â©a nÃ¡Â»â„¢i dung sÃ¡ÂºÂ½ Ã„â€˜Ã†Â°Ã¡Â»Â£c hiÃ¡Â»Æ’n thÃ¡Â»â€¹
var text;
text= "<b style='color:#00F' " + 
"style='text-align:center'>(주)엘리소프트<br />" + 
" 서울시 서초구 서초동 1617-34번지 3층 </b>";
   var infowindow = new google.maps.InfoWindow(
    { content: text,
        size: new google.maps.Size(100,50),
        position: myLatlng
    });
       infowindow.open(map);    
    var marker = new google.maps.Marker({
      position: myLatlng, 
      map: map,
      title:"(주)엘리소프트!"
  });
}
</script>
<script type="text/javascript">
function contacts(){
	var clientname = $('#clientname').val();
	if(clientname==''){
		$('#clientname').focus();
		return false;
	}
	var clientemail = $('#clientemail').val();
	if(clientemail==''){
		$('#clientemail').focus();
		return false;
	}else{
		if(!validEmail($('#clientemail'),clientemail)){
			return false;
		}
	}
	var contactcontent = $('#contactcontent').val();
	if(contactcontent==''){
		$('#contactcontent').focus();
		return false;
	}
	
	$.ajax({url:"ajax/contacts.php",data : $('#formcontact').serialize(),success:function(result){		
		alert('Contact successful');
	}});
}

function validEmail(ele,val){
	var atPos = val.indexOf("@");
	var docPos = val.lastIndexOf(".");
	if(atPos<1 || dotPos<atPost+2 || dotPos+2>=val.length){
		$(ele).focus();
		return false;
	}return true;
}

</script>
</head>

<body 
<?php 
if(isset($_REQUEST['vcontent']) && $_REQUEST['vcontent']=="contact_content"){
	?>onload="initialize();"<?php 
}
?>
>
	<div id="wrapper">
		<div id="top">
			<img src="images/logo.png" alt="logo" />
			<div style="float:right;padding-right: 5px;padding-bottom: 20px;padding-top: 15px;">
				<?php 
				if ( !isset($_REQUEST['page'] ))
				{
			    	$page = 1 ;
				}else{
					$page = $_REQUEST['page'] ;
				}
				$_SESSION['rows_page']=20;
				$rows_per_page = $_SESSION['rows_page'];
				$page_start = ( $page - 1 ) * $rows_per_page; 
				$page_end = $page * $rows_per_page;
				if(isset($_SESSION['useradmin'])){
					echo $l_welcome;?>&nbsp;<font color="green"><b><?php echo $_SESSION['useradmin'];?></b></font> - <a href="logout.php?"><b><?=$l_logout?></b></a><?php 
				}else{
					?><a href="index.php?vcontent=admin_login_content"><?=$l_login?></a><?php 
				}
				?>
			</div>
		</div>
		<?php include 'main.php';?>

		<div id="main">
			<?php 
				if(isset($_REQUEST['vcontent'])){
					include "content/".$_REQUEST['vcontent'].".php";
				}else{
					include 'content/index_content.php';
				}
			?>
		</div>
		<!--end main-->

		<?php include_once 'footer.php';?>
	</div>
	<!-- end wapper-->
</body>
</html>
